/*
 * AppConst.cpp
 *
 *  Created on: 2018年1月2日
 *      Author: zhengboyuan
 */

#include "AppConst.h"
#include "Path.h"

AppConst::AppConst()
{
}

AppConst::~AppConst()
{
}


int AppConst::SEND_BUFFER_SIZE = 1024 * 1024 * 2;

int AppConst::SOCKET_BUFFER_SIZE = 1024 * 1024 * 2;

int AppConst::CHANNEL_TIMEOUT = 60;

int AppConst::COMMAND_TIMEOUT = 10;

int AppConst::MESSAGE_TIMEOUT = 3;

bool AppConst::DUMP_ENABLED = false;

int AppConst::DELAY_CLOSE = 1000;

int AppConst::RECORD_DURATION = 60 * 10;

std::string AppConst::s_appDir = "/usr/local/DevAgent";

const char*  AppConst::SYSLOG_FILENAME = "syslog.s3db";

bool AppConst::IS_TRIAL_VERSION = false;
int64_t	AppConst::EXPIRY = 0;
int  AppConst::MAX_CHANNEL_COUNT = 2;
std::string AppConst::APP_ID = "devagent";

int AppConst::HTTP_PORT = 9000;

int AppConst::FLV_PORT  = 9550;
int AppConst::RTSP_PORT = 9554;


//static const char* TMP_DIR = "/tmp";

int AppConst::SUPER_USER_ID = 0;
const char* AppConst::SUPER_USER = "root";
const char* AppConst::SUPER_PASSWORD = "100wits";


std::string AppConst::getInstallDir()
{
    return getAppDir();
}

std::string AppConst::getAppDir()
{
	if (s_appDir.empty())
	{
		return comn::Path::getWorkDir();
	}
    return s_appDir;
}

void AppConst::setAppDir(const std::string& dir)
{
    s_appDir = dir;
}

std::string AppConst::getEtcDir()
{
    return comn::Path::join(getAppDir(), "conf");
}
